#include "class-engine.h"

	cEngine	*engine		= new cEngine;	// Instance the engine
	cTimer	*gfxTimer	= new cTimer;	// set a timer for use with gfx timing

	vector<cAsset*>		assets;		// Make a vector of asset class pointers
	vector<cAnimation*> animations;	// Make a vector of animation class pointers
	vector<cEntity*>	entities;	// Make a vector of entity class pointers

	cController *controller = new cController; // Instance the controller class

	sMouse    *mouse    = new sMouse;		// The Virtual mouse

int main(int argc, char *argv[]){

	gfxTimer->fpsTarget = 60;	// Set the framerate for the gfxTimer

	controller->addToAssets();
	controller->addToAnimations();

	for (int x=0; x<1; x++){

		controller->addToEntities();
		
		entities[x]->x = rand() % 1024;
		entities[x]->y = rand() % 768;
	}
	
	entities[0]->x = 512;
	entities[0]->y = 384;

	assets[0]->loadAsset("gfx/image.png");

	engine->cls();

	/***
	 * The Main Loop
	 **/

	bool loop = true;

	int i = 0;

	while(loop){

		engine->getEvent();
		engine->getMouse(*mouse);

		if (gfxTimer->update()){

			engine->cls();

			// Loop through, and modify the entities
			for (i=0; i<(int)entities.size(); i++){

				entities[i]->logic();
				entities[i]->render();
			}

			engine->refresh();
		}
	}   
    
	return 0;
}